<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta name="viewport"
          content="width=device-width, initial-scale=1.0">
  </head>

  <body>
  <div>
    
    <div ng-include="headerInclude"></div>
    <div ng-controller="Apiman.ApiPoliciesController"
         class="page container-pf-nav-pf-vertical container-fluid"
         data-field="page"
         ng-cloak=""
         ng-show="pageState == 'loaded'">
      <div ng-include="'plugins/api-manager/html/api/api_bc.include'"></div>
      <!-- Entity Summary Row -->
      <div ng-include="'plugins/api-manager/html/api/api_entity.include'"></div>

      <!-- Navigation + Content Row -->
      <div class="row">
        <!-- Left hand nav -->
        <div ng-include="'plugins/api-manager/html/api/api_tabs.include'"></div>
        <!-- /Left hand nav -->

        <!-- Content -->
        <div class="col-md-10 apiman-entity-content">
          <div class="col-md-9">
            <!-- Title and help text -->
            <div class="title"
                 apiman-i18n-key="api-policies">API Policies</div>
            <div class="description"
                 apiman-i18n-key="api-policies-help">Here is a list of all policies defined for this API. These policies
              will be applied to all invocations of this API by any client, regardless of the plan used in its contract.
            </div>
            <hr />
            <!-- The list of policies -->
            <div apiman-permission="apiEdit"
                 ng-show="!isEntityDisabled()"
                 class="apiman-filters apiman-policies-filters">
              <a apiman-i18n-key="add-policy"
                 href="{{ pluginName }}/orgs/{{ org.id }}/apis/{{ api.id }}/{{ version.version }}/new-policy" class="btn btn-primary pull-right">Add Policy</a>
            </div>
            <div class="clearfix"></div>
            <div class="apiman-policies"
                 data-field="policies">

              <div class="apiman-no-content container-fluid"
                   ng-hide="policies.length > 0">
                <div class="row">
                  <div class="col-md-9" ng-show="!isEntityDisabled()">
                    <p class="apiman-no-entities-description"
                       apiman-i18n-key="no-policies-for-api-enabled">No policies are defined yet. Use the <strong>Add
                      Policy</strong> button above to define a new policy.</p>
                  </div>
                  <div class="col-md-9" ng-show="isEntityDisabled()">
                    <p class="apiman-no-entities-description"
                       apiman-i18n-key="no-policies-for-api-disabled">It looks like there aren't any policies defined and the API is already published!  Hopefully that was your goal with this API...</p>
                  </div>
                  <div apiman-permission="apiEdit"
                       ng-show="!isEntityDisabled()"
                       class="col-md-3">
                    <div class="apiman-no-entities-arrow"></div>
                  </div>
                </div>
              </div>
              <div class="clearfix"></div>
              <apiman-policy-list ng-model="policies"
                                  remove-function="removePolicy"
                                  reorder-function="reorderPolicies"
                                  type="apis"
                                  org-id="{{ org.id }}"
                                  page-id="{{ api.id }}"
                                  version="{{ version.version }}"></apiman-policy-list>
            </div>
          </div>
        </div>
        <!-- /Content -->
      </div>
    </div> <!-- /container-pf-nav-pf-vertical container-fluid -->
  </div>
  </body>
</html>
